package ferp.android.views.table.animation;

import android.view.animation.Animation;
import ferp.android.views.CardView;
import ferp.android.views.table.TableView;
import ferp.core.game.Game;

/**
* User: olegs
* Date: 04/01/2015 22:56
*/
public class AnimationUndoListener extends AnimationListener
{
  public AnimationUndoListener(TableView table, CardView view)
  {
    super(table, view);
  }

  @Override
  protected void onRealAnimationStart(Animation animation) {view.show(true);}

  @Override
  protected void onRealAnimationEnd(Animation animation)
  {
    Game g = table.game();

    view.clearAnimation();

    table.showPlayerCards(g, table.settings(), g.player.current);
    table.enablePlayerCards(g.player.current, g.options.hand);
    table.resetController();
  }
}
